<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>动态下拉demo</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" href="/static/lib/layui/css/layui.css"  media="all">
</head>
<body>
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
      <legend>Layui动态下拉演示</legend>
    </fieldset>

    <form class="layui-form">
        <div class="layui-form-item">
            <label class="layui-form-label">英雄选择</label>
            <div class="layui-input-block">
                <select name="role_id" lay-verify="required" data-select="{:url('login/test')}" data-key="user_id" data-fields="name" data-value=""></select>
            </div>
        </div>
    </form>

    <script src="/static/lib/layui/layui.js" charset="utf-8"></script>
    <script>
        layui.config({
            base: '/static/lib/layui/extend/'
        }).extend({
            selectD: 'selectD/selectD'
        }).use(['selectD'], function () {
            var selectD = layui.selectD;
            selectD.render();
        });
    </script>
</body>
</html>